

use "$datadir\ewallet\maindata.dta", clear
	
	sum min_distance_hub_500, d
	g far_from_hub = min_distance_hub_500 > 0.1
	
	g postXdistdummy = post*far_from_hub
	g postXtreatXdistdummy = postXtreatment*far_from_hub

	*** Triple-interaction (using binary distance variable)
	reghdfe  logamount postXtreatment postXdistdummy postXtreatXdistdummy if $filters, a($fe $dist_controls##i.time_id i.state_id##i.time_id) cluster(district_id)
	outreg2 using "$outputdir_tab\Table_H_8", tex(frag) ctitle("log(amount)") dec(3) bracket label addtext(District f.e. , $\checkmark$ , Month f.e. , $\checkmark$ , District Controls $\times$ Month f.e., $\checkmark$, State $\times$ Month f.e., $\checkmark$ ) nocons nonotes stats(coef se)  replace
	reghdfe  lognumfirms postXtreatment postXdistdummy postXtreatXdistdummy if $filters, a($fe $dist_controls##i.time_id i.state_id##i.time_id) cluster(district_id)
	outreg2 using "$outputdir_tab\Table_H_8", tex(frag) ctitle("log(users)") dec(3) bracket label addtext(District f.e. , $\checkmark$ , Month f.e. , $\checkmark$ , District Controls $\times$ Month f.e., $\checkmark$, State $\times$ Month f.e., $\checkmark$ ) nocons nonotes stats(coef se)  append
	reghdfe  lognewfirms postXtreatment postXdistdummy postXtreatXdistdummy if $filters, a($fe $dist_controls##i.time_id i.state_id##i.time_id) cluster(district_id)
	outreg2 using "$outputdir_tab\Table_H_8", tex(frag) ctitle("log(switchers)") dec(3) bracket label addtext(District f.e. , $\checkmark$ , Month f.e. , $\checkmark$ , District Controls $\times$ Month f.e., $\checkmark$, State $\times$ Month f.e., $\checkmark$ ) nocons nonotes stats(coef se)  append
	